'''
Created on May 22, 2009

@author: Roni
'''
from cliques.cliqueAlgorithm import cliqueAlgorithm

class knownDegreeSearch(cliqueAlgorithm):
    '''
    classdocs
    '''

    def __init__(self):
        '''
        Constructor
        '''
        cliqueAlgorithm.__init__(self)

    def choose_node(self):
        max_degree = -1
        
        best_node = None
        for node in self.generated:
            degree=len(self.ckg.neighbors(node))
            if max_degree<degree:
                max_degree=degree
                best_node=node
        return best_node

    def __str__(self):
        return "knownDegree"